using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using ShopForWeb.Services;
using ShopForWeb.UI.Models;
using ShopForWeb.UI.Utils.Filters;

namespace ShopForWeb.UI.Controllers;
[UserInfo]
public class HomeController : Controller
{
    private readonly ILogger<HomeController> _logger;
    private ProductService  _productService;


    public HomeController(ILogger<HomeController> logger,ProductService  productService)
    {
        _logger = logger;
        _productService=productService;
    }

    public async Task<IActionResult> IndexAsync()
    {
        var list=await _productService.GetByPageAsync(1,9,1,"",[]);
        ViewBag.ProductList=list;
        return View();
    }

    public IActionResult Privacy()
    {
        return View();
    }
 
   
}
